<template>
  <div>
    <!-- <el-backtop target=".h1" :bottom="100">
      <div
        style="
           {
            height: 100%;
            width: 100%;
            background-color: #f2f5f6;
            box-shadow: 0 0 6px rgba(0, 0, 0, 0.12);
            text-align: center;
            line-height: 40px;
            color: #1989fa;
          }
        "
      >
        回到顶部
      </div>
    </el-backtop> -->
    <h1>世间姿态万千<br />吾将上下求索</h1>
    <el-button type="success" round @click="login">开始使用</el-button>
    <div class="background"><span>求索</span></div>
    <h2>
      &nbsp;&nbsp;&nbsp;&nbsp;"路漫漫其修远兮，吾将上下而求索。"语出屈原名作《离骚》，意思是路途悠长而且很遥远，我要不断的去寻找真理。世间姿态万千，缤纷满目，我们要去探寻这世间的种种光怪陆离，找寻背后的真理，这也是我们平台的出发点：致力于为用户打造一个好的问卷平台，帮助大家更好的提出问题、收集信息。
    </h2>

    <div class="card" style="top: 115vh">
      <img
        class="card_img"
        src="../../img/wenjuan.png"
        alt=""
        style="float: left"
      />
      <div class="card_text" style="float: right">
        <div class="title">“求”诸世界，“索”得真理</div>
        <div class="text_font">
          深度集成二维码分享、限时收集、问卷密码等强大功能，帮您轻松设计发布问卷、完成社会调查、满意度调查等各类在线问卷调查、保护用户隐私。
        </div>
        <div class="features">
          <ul class="features-one pull-left">
            <li>
              <i></i>
              <span>轻松设计问卷</span>
            </li>
            <li>
              <i></i>
              <span>多渠道发布问卷</span>
            </li>
            <li>
              <i></i>
              <span>用户体验友好</span>
            </li>
          </ul>
          <ul class="features-two pull-left">
            <li>
              <i></i>
              <span>问卷快捷导出</span>
            </li>
            <li>
              <i></i>
              <span>图表分析数据</span>
            </li>
            <li>
              <i></i>
              <span>问卷类型多样</span>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div class="card" style="top: 165vh">
      <img
        class="card_img"
        src="../../img/test.png"
        alt=""
        style="float: right"
      />
      <div class="card_text" style="float: left">
        <div class="title">考试问卷，一站搞定</div>
        <div class="text_font">
          深度结合考试场景，乱序发题、定时收卷、实时保存、客观评分。助力线上考试，共度疫情难关。
        </div>
        <div class="features">
          <ul class="features-one pull-left">
            <li>
              <i></i>
              <span>题目轻松设置</span>
            </li>
            <li>
              <i></i>
              <span>考试限时答题</span>
            </li>
            <li>
              <i></i>
              <span>系统自动阅卷</span>
            </li>
          </ul>
          <ul class="features-two pull-left">
            <li>
              <i></i>
              <span>乱序分发题目</span>
            </li>
            <li>
              <i></i>
              <span>答卷实时保存</span>
            </li>
            <li>
              <i></i>
              <span>成绩报表查询</span>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div class="card" style="top: 215vh">
      <img
        class="card_img"
        src="../../img/vote.png"
        alt=""
        style="float: left"
      />
      <div class="card_text" style="float: right">
        <div class="title">报名投票，尽在掌握</div>
        <div class="text_font">
          招募员工、投票评选，一个问卷让您快速招募人手、收集数据，分分钟完成大量工作
        </div>
        <div class="features">
          <ul class="features-one pull-left">
            <li>
              <i></i>
              <span>活动报名</span>
            </li>
            <li>
              <i></i>
              <span>信息收集</span>
            </li>
            <li>
              <i></i>
              <span>投票选举</span>
            </li>
          </ul>
          <ul class="features-two pull-left">
            <li>
              <i></i>
              <span>数据实时更新</span>
            </li>
            <li>
              <i></i>
              <span>图表展示清晰</span>
            </li>
            <li>
              <i></i>
              <span>口令保证安全</span>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
const background = document.querySelector(".background");

// document.addEventListener("scroll", () => {
//   const scrollY = window.scrollY;

//   if (scrollY !== 0) {
//     background.style.backgroundPosition = `calc(50% + ${scrollY}px) calc(50% + ${scrollY}px)`;
//   } else {
//     background.style.backgroundPosition = "";
//   }
// });

export default {
  // data: function () {
  //   return {
  //     show1: true,
  //     show2: true,
  //     show3: false,
  //   };
  // },
  // computed: {
  //   top() {
  //     return this.$store.state.scrollTop;
  //   },
  // },
  // watch: {
  //   top(val) {
  //     if (val >= 0) {
  //       this.show1 = true;
  //     }
  //     if (val > 360) {
  //       this.show2 = true;
  //     }
  //   },
  // },
  // mounted() {
  //   window.addEventListener("scroll", this.handleScroll, true);
  // },
  methods: {
    login() {
      this.$router.push("/login");
    },
    // handleScroll() {
    //   let scrollTop =
    //     document.body.scrollTop || document.documentElement.scrollTop;
    //   this.height = scrollTop;
    //   this.$store.commit("setScrollTop", scrollTop);
    // },
  },
};
</script>

<style  lang="less" scoped>
html,
body {
  margin: 0;
  padding: 0;
  height: 200vh;
  /* overflow-x: hidden; */
}

.background {
  background-image: url("../../img/introduction.jpg");
  /* 相对于视口固定 */
  background-attachment: fixed;
  background-size: cover;
  background-position: 50% 50%;
  height: 260vh;
  // font: 900 22rem "";
  font-weight: 900;
  font-size: 300px;
  line-height: 66vh;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  text-align: center;
  overflow: hidden;
}

/* 在最底下放这个图片 */
.background::before {
  content: "";
  background-size: cover;
  background-image: inherit;
  background-position: 50% 50%;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  height: 100vh;
  z-index: -10;
}

h1 {
  position: absolute;
  text-align: center;
  width: 100%;
  letter-spacing: 10px;
  color: #fff;
}

h2 {
  position: absolute;
  letter-spacing: 2px;
  top: 70vh;
  width: 60%;
  color: #fff;
  left: 50%;
  transform: translateX(-50%);
  padding: 30px;
  background-color: rgba(0, 0, 0, 0.3);
}

.card {
  position: absolute;
  width: 70%;
  height: 340px;
  left: 50%;
  transform: translateX(-50%);
  background: #f5f8fa;
}
@keyframes card {
  0% {
    transform: translateY(200px);
  }
  100% {
    transform: translateY(0px);
  }
}
.card_img {
  width: 25%;
  height: 100%;
  margin-left: 5%;
  margin-right: 5%;
}

.card_text {
  width: 55%;
  height: 100%;
  position: relative;
  overflow: hidden;
  margin-left: 5%;
  margin-right: 5%;
}

.title {
  margin-top: 3%;
  position: relative;
  left: 0;
  // text-align: center;
  width: 100%;
  font-size: 32px;
}

.text_font {
  margin-top: 4%;
  position: relative;
  left: 0;
  width: 100%;
  font-size: 20px;
  color: #808080;
  line-height: 24px;
}

/deep/ .el-button {
  position: absolute;
  top: 60vh;
  left: 39%;
  width: 22%;
  height: 8%;
  background: transparent;
  border-color: #f79d37;
  color: #f79d37;
  font-size: 26px;
  letter-spacing: 10px;
  z-index: 1;
}

/deep/ .el-button--success:focus,
.el-button--success:hover {
  background: #f79d37;
  border-color: #f79d37;
  color: #fff;
}

// 滑动动画
// .slide-top {
//   position: relative;
//   animation: slide-top 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
// }

// @keyframes slide-top {
//   0% {
//     transform: translateY(200px);
//   }
//   100% {
//     transform: translateY(0px);
//   }
// }

.pull-right {
  float: right !important;
}

.pull-left {
  float: left !important;
}

.features {
  background: rgb(220, 237, 253);
  position: absolute;
  top: 180px;
  left: 0;
  line-height: 40px;
  width: 100%;
  margin-bottom: 16px;
  // opacity: 0;
  // filter: alpha(opacity=0);
}

.features-one {
  margin-top: 3%;
  margin-left: 2%;
  font-size: 24px;
}
.features-two {
  margin-top: 3%;
  margin-left: 6%;
  font-size: 24px;
}
</style>